/*
 * LatexButton class extends JButton
 * used for dynamic buttons for Latex Commands
 * THIS IS FOR v1.1
 */
package com.meraklisina.latexeditor;

import java.awt.Dimension;

import javax.swing.ImageIcon;
import javax.swing.JButton;

/**
 * 
 * @author kursattopcu
 */
public class LatexButton extends JButton {

	private String prefix;
	private String suffix;
	private String expressionTemplate;
	private String iconPath;

	private String commandFullPath;

	public LatexButton(String buttonName, String iconPath, String toolTip, String prefix, String suffix, String expressionTemplate, String commandFullPath) {
		this.setName(buttonName);
		ImageIcon icon = new ImageIcon(iconPath);
		if (icon != null) {
			this.setIcon(icon);
			this.setIconPath(iconPath);
		}
		this.setToolTipText(toolTip);
		this.setPrefix(prefix);
		this.setSuffix(suffix);
		this.setExpressionTemplate(expressionTemplate);
		this.setPreferredSize(new Dimension(25, 25));
		this.setMaximumSize(new Dimension(25, 25));
		this.setCommandFullPath(commandFullPath);
	}

	public String getFullActionTemplate() {
		return commandFullPath + "_" + expressionTemplate;
	}

	public void setIconPath(String iconPath) {
		this.iconPath = iconPath;
	}

	public String getIconPath() {
		return iconPath;
	}

	public void setExpressionTemplate(String expressionTemplate) {
		this.expressionTemplate = expressionTemplate;
	}

	public void setPrefix(String prefix) {
		this.prefix = prefix;
	}

	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}

	public String getExpressionTemplate() {
		return expressionTemplate;
	}

	public String getPrefix() {
		return prefix;
	}

	public String getSuffix() {
		return suffix;
	}

	public String getCommandFullPath() {
		return commandFullPath;
	}

	public void setCommandFullPath(String commandFullPath) {
		this.commandFullPath = commandFullPath;
	}
}
